***** Create WFH adoption measure using the ACS data 
cd "C:\Users\alen_\Dropbox\burning_glass\data"


u "2018_2020.dta", clear
append using "2022.dta"

drop if tranwork==0
keep if uhrswork>=35
keep if age>=25 & age<=65
bysort met2013: egen total_perwt=total(perwt)
bysort met2013 occ2010: egen M=total(perwt)
sum incwage
g ln_wage=ln(incwage/(uhrswork*52))
g ln_total_perwt=ln(total_perwt)
g ln_M=ln(M)
drop if met2013==0

g remote_acs=0
replace remote_acs=1 if tranwork==80

keep if year==2018 | year==2022 

collapse remote_acs [w=perwt], by(occ2010 year)

by occ2010: g dremote_acs=remote_acs-remote_acs[_n-1]

keep occ2010 dremote_acs 

drop if dremote_acs==.

save remote_dummy_based_on_acs, replace
